Skip to content

feat(ui): full access mode — opt-in auto-run without destructive-command pause (PR 0004) - #167

Open
tokg-venv wants to merge 3 commits into
deer-flow:mainfrom
tokg-venv:pr/0004-full-access-mode
Open

feat(ui): full access mode — opt-in auto-run without destructive-command pause (PR 0004)#167
tokg-venv wants to merge 3 commits into
deer-flow:mainfrom
tokg-venv:pr/0004-full-access-mode

Conversation

@tokg-venv

Copy link
Copy Markdown
Contributor

Summary

Implements spec 0004: an opt-in "Full access mode" for users who run the agent unattended on their own machine. When enabled together with auto-run tools, auto-run no longer pauses on bash commands flagged destructive (isDangerousBashCommand): every tool call executes automatically.

Safety posture (deliberate guardrail trade-off — please scrutinize):

  • Off by default; affects only local auto-run behavior, no runtime-layer changes.
  • First-time enable requires an explicit, unskippable risk-acknowledgement dialog (destructive confirm). Reinstalling or clearing storage re-asks.
  • A persistent amber "Full access" badge stays visible in the toolbar while the mode is on; each run shows a dismissible warning toast.
  • Scope is limited to the destructive-bash pause: control-flow tools such as terminate remain never-auto-executed. Without auto-run enabled, the mode has no effect.

Details

  • run-mode.ts: get/setFullAccessMode + get/setFullAccessAcknowledged (localStorage) + useSyncExternalStore subscription; useRunMode exposes fullAccessMode
  • thread-store.ts: getFullAccessMode option read fresh at run time; the destructive-bash interception skips the pause only when enabled; per-run warning toast
  • thread-playground.tsx: wires the option through and renders the badge
  • Experimental settings: toggle + confirmation dialog (en/zh copy)

Test plan

  • thread-store-full-access.test.ts: dangerous bash auto-runs when the mode is on, pauses when off, acknowledgement flow, badge wiring — passes
  • bun run typecheck:changed / bun run lint:changed clean

zcai7675-bot added 3 commits September 8, 2026 21:06
…and pause (PR 0004)

Add an opt-in 'Full access mode' for users who run the agent unattended on
their own machine. When enabled together with auto-run tools, auto-run no
longer pauses on bash commands flagged destructive (isDangerousBashCommand):
every tool call executes automatically.

Safety posture:
- Off by default; only affects local auto-run behavior (no runtime layer).
- First-time enable requires an explicit, unskippable risk acknowledgement
  dialog (destructive confirm). Reinstall/cleared storage re-asks.
- A persistent amber 'Full access' badge stays visible in the toolbar while
  the mode is on; each run shows a dismissible warning toast.
- Scope is limited to the destructive-bash pause: control-flow tools such as
  'terminate' remain never-auto-executed. Without auto-run enabled the mode
  has no effect.

- run-mode.ts: get/setFullAccessMode + get/setFullAccessAcknowledged
  (localStorage) + useSyncExternalStore subscription; useRunMode exposes
  fullAccessMode.
- thread-store.ts: getFullAccessMode option read fresh at run time; bash
  interception skips the pause when enabled; per-run warning toast.
- thread-playground.tsx: wires the option through and renders the badge.
- Experimental settings: toggle + confirmation dialog (en/zh copy).

Tests: thread-store-full-access.test.ts — dangerous bash auto-runs when
mode is on, pauses when off, acknowledged flow, badge wiring.
The destructive-bash gate read full access mode once, before a batch that
contains a Plugin Tool resolved its prompt variables. That resolution is a
real await, so switching the mode off while the batch was being prepared
still ran the batch — including a bash command flagged destructive.

- thread-store.ts: gate through `isRiskPaused`, which reads the mode on
  every check, and run the gate again after the asynchronous preparation,
  immediately before anything executes.
- thread-store-full-access.test.ts: mid-batch regression test (it executes
  both tools before this change and nothing after) plus a control that a
  Plugin Tool batch still auto-runs while the mode stays on.
- run-mode.test.ts: cover the stored full-access state the settings
  acknowledgement flow depends on (off and unacknowledged by default, the
  acknowledgement and the mode on separate keys, cleared storage asks again).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant